Added tension plot, debugged code