Refactored the queue/stack functionality into its own class