Code cleanup

deleted unused code, etc.