Modified so it compiles...god knows if it will run