cleaned up some code not very much done