Completed conversion function