implemented srpt algorithm