adding tricks for problem 51
adding problem 51