updated several functions