Updated php script to do unwrap