smale modifications for code readability