re-arranging packages and separating classes in files.
adding comments and re-factoring some code.