cleaned up code, working on adaptive constant demand algo; need to make better interface for setting instance types