added some more Q-learning functions and integrated global objective code