Finalized Salination Controller algo