Pascal's triangle implementation
refactorisation