Better solution

Added a solution which is significantly smaller