removed unused code, fixed types