fixing kyle's code