more thoroughly added functions into