gravity simplify collision code