Add comments and remove unused code.