optimised : line 7(key.to_i.even?)  made more readable, split it into separate code]