Small logic improvements, dumbed down but works better.