Attempt at third exercise