added cdi library and some other nice functions