added functions definitions