Added new function to library. Tests for library.