Major class initialization rebuild and added comments.

Now entire work is done with only two lines of code. Some new public and private methods added for better flexibility.