Added abs(); call so that the distance check hack works correctly