functions for convertation