Adapted Assignment 3 to also take consistency in account