consolidated sine parameters into params variable, added legend to plot