Fixed vertices indexing.
Cleaning code