Adding sim51's solutions

My solution