finished problem A5