errors fixed
code clean up