created functions code