refactored queue storage from linked list to array