removed call to secondaries
indented functions