Initial version of subroutine check - ksh based