Logic behind ex now works