Changed the order of window updates to fix a bug; removed commented-out code.