Added functions code.