some unused functions and some comments removed