using different approach for detecting a number