fixed bug 3 (secondary)
fixed bugs 7, 20. bug 20 required a rewrite of program logic that I'm not certain is going to be completely acceptable.