Implemented Pascal's Triangle algorithm