Non optimal solution for more complicated test