fixed some bugs, code cleanup, commented out some stuff that is not needed atm