Added a more flexible way of adding vertices. The performance with it at times can be quite poor though