Debugged version1.