tidied up conversion