cleaning up code, removing debug stuff and old comments mostly