optimizes some rect collision stuff