added stateParams functionality including test.