hopefully fixed freakout bug and lots of improvements