completed first working script; takes 3 arguments