Fixed typo which caused incorrect behaviour

In the for loop I accidentally wrote '>' instead of '<'.