finish key scheduling algo