almost fully implemented; working at least