clean up

renamed some functions and some code fixes
Renamed ns