fixed some warnings and removed some old code