added source and tests to library