cleaned up code, removed test code