Added simplified code.