added unit tests for writeVertex