Update mainCode

tries to get diagonal by calculating startpoint (not working)