adding some mor stuff and cleaning up some code