Fixed a few things in the program.

* Dotproduct now a public static method so there is no need to call V.dotproduct, instead if can be more uniform with Vertex.dotproduct

* Same goes with Matrix.apply