Added dictionary support for the length function