Rather than taking isolated sections out of context, I suggest you make the effort to read the whole of Scripture before you criticize it or God. If you do not do so, you are taking it upon yourself to criticize out of ignorance what is without question the most influential book ever written. It takes a monumental ego to assail so important a book down through history without ever having read it.
After reading it, feel free to criticize, if you must.