Adding doc strings and tests