Fixed issue where interaction was not defined. 

Fixed issue where interaction was not defined. Also unified formatting (it was using spaces in some places before and tabs elsewhere).