factorial subroutine - lab4