Add function length (with a test in the main)