added test cases, fixed edge index key insertion