Added functions for pseudo-inverse.