fix a bug

* add a for loop in create_node()
* add i = i - 1 in delete_node()