use recursion on calculator and set basis for programmable calculator