Dirty way solving problem 1