Finished constructor, calcIndex