calculating section number correctly