implemented first() and last()
updated documentation