add main function
compute length frequences