delete unused lines
delete unused lines
some fixes and additions