fixed all compile errors (still need to address manual conversion