Updated function signature to include an options argument. Removed redundancies. Updated tests and doc.