What's the head doing? Scrap the pipes and move this to Ruby logic.