removed obsolete code, added some comments