lot of clean up and some comments too