implemented caclulateIndizes in Main, which will be called by gui