Added tension modification.

Also reorganized some code and improved on it overall.