Updated doc-strings and changed the script attribute to function