added getFreeVertices
more memory ops
fixes for varying buffer size