cleaned up code, but not ready yet2