Changing logic to purely combinational