Got rid of QueueNode class by adding a field 'next' to existing Node class.