281A problem solution
Improved code according to hlint suggestions