Hopefully working scheduler