Initial try

Less elegant solution