fixed plot fxn to work, uncommented code