Added first and last methods, added unit tests