removing the usage of 'shift'

also:
* explicit variable name in the 'foreach' loop
* s/add_vertices/add_vertex/