Updated _get_edges function

Modified get edges to make use of the ctypes wrapper. Should be faster.