started work on a recursive parially applying function