Moved functions. Added pseudo debugger.