updated the sample main file to properly use the decode and encode functions.