took out unnecessary off-by-one in Gates module