starting to abstract analytical functions