Major fixes to Length.cs and Program.cs