fix warnings and stuff
remove unused functions