Fixed things, added math inside matrix declarations, and added factorials.