reimplemented reading, now can read vertices as well