simplifies the code; replace modulo and enumerate() w/ range()