updated code as of thursday night