Solution to ex6a