Added scheduler
Various misc changes