added transcode method and spec
refactored the spec file