shorter code to obtain section index