Updated while condition for red pixels completion
Various updates