Change rect to ints, added some min/max functions