cleanup and added unworking unwrap code