Very simple and non-optimal solution to problem