Made code more idiomatic with primes (thought I already did this, but I must have missed these lines somehow).