Merged Alex's branch into warren's update, and fixed merge conflicts.