Added documentation; return correct numpy matrix