moved auto_ptr to beginning