added math defines and Matrix class