complete function for form cities as linkedlist