exercise d, not working properly