completed working version of converter