Ant problem refacrored