modify simplePascal function