now it takes more arguments and does more things