fix stupid bug with determining the number of marks