improvements on testing
unused var removed