very rough code and a couple of bad slides