cleaning up, bug fixes