fixed a bug and found another one. Oh, the joys of programming
jk now fixed