ex04 accepted solution