added basic change detection and modified queue slightly