optimized a bit
added problem 20