Simplified class and removed for loop.