First attempt at solution