added solution for 4)