Added comments and docstrs