adding functions library and checks