Debugged Version.