Update main.c

Made some length values dependent on "dit"-length