Added functions code