Algorithm skeleton ready. Just add the subroutines\!