The boolean result value should be originally set to true rather than false.

Where you have;

boolean result = false;

You should have;

boolean result = true;