added part of function implementation