Debugged after testing