Add comments. Rename more variables for clarity
Fix wrong callback name.