lines 770 & 771 are not needed; the elif at line 772 can be made into an if. Then I think this is ready.