updated command method to include linked list to operate on