Minor modifications for memory and comments