Fixes formatting and adds comments