fixed issue #11

I fixed issue #11 - it is possible to use either a method like length or reference an element.
There's a unit test also.