Add length

fixes #548, @gregcaporaso, can you review please?