made the code more readable, switched place of parameters