Completed Library

Now with improved functions, documentation, and error checking