Conversion done
Refactoring and added some comments.
Merge pull request #1 from ignazioc/master

Initial conversion code