Refactored to have a more readable check for multiples of 3.