Wrote a bad version of the problem statement