More error logging, add explanation.
Clean code, prepare for vertices with more than two connections.