Add legacy sample codes