halfway done converting to object oriented system