Some modifications to scheme, still incomplete.