Add comments and format the code
Remove the debug code in a test