minimized and improved reaper logic