Fixed logical errors in code - now test param