added ability to specify multiple objective functions with weights; this required some restructuring