Added some working stuff to the convert function.