Added an alternative solution to 3a