Rewrite task 4