Adapting partial nitritation-anammox process to mainstream wastewater treatment