Almost there - parsing pretty close and saving/encoding now working