changed authority calculation slightly, added debugging print statements