correct some logic. renamed some concepts