modified to remove zero gravity