add Pascal's triangle building algorithm