fixed nullpointer and other issues
added new classes, repackaged and organized