Fixed variable names and function comments