Changed auxiliary functions to direct style in lieu de CPS.