Finalising min, max functions