Author		date	Description
rdpeng				Original
gabadia         10/26/2014	Refactoring so that function applies to a
matrix instead of a vector