Removed References to $state, removed ampersand on subroutine call