A method of program refinement