added some comments, removed unused code, removed search field in header