Added more logic for adding hypotheses