random name changes and cleaning of code