Removed statement that would make some of this unreachable. But I think this whole thing needs to be reworked,.