Removed the lengths method for simpler code, issue #10.