updated the program based on stuff from dan