Change code formatting and add comments
Ignore repeat events