Add comments and clean up