added tests and header function