changed gain to one away from the max instead of the max
added a plotting program