Implemented grid quality check and planning ahead