seems to be working
cleaning up the code