Fixing up logic and deleting krufty code