added convert function