added end() method