The computation of general problems in one dimensional unsteady flow by the method of characteristics