stable codes for the 3 functions. Revised output. Pawan