added more implementations of the pascal method