cleaned up and tested