fixed a bug identified by Bob.  added max/min scaling.  read_data function