problem 50 is faster and adding tests