removing unused functions from imports
some initial work on specifying types. I think it is wrong.