Changes exercise 5.2

SEEMS TO BE A BUG!
But improved/updated code