Gaussian pivot implementation using Javascript