Original code, before modifications.