piq scheduler code