Adds logic for generating pascal's triangle