Added several functions definitions