implemnted several functions