cleaned up and changed a bit