Add comments and clean up old code.