mostly done, bug fixes left