solved ex1 from sw5