rewrote using things learnt from writing shipping service