Modified main functions to take ontology as a first argument.