Functions and tests added

Adding library and tests