Same solution, more efficient.