clean up code, start extensive testing