update for lengths
lengths nearly working