cleaned up like code somewhat