fixed oodles of bugs and improved interface slightly