modified code to let compiler emit better binary.