further improving solution to #55