add gravity and anti_gravity function