added ifndef blocks so that the library can be included by multiple interdependent files