Debugged version