Merged Sopheary and Thomas' work.