Some more fixes in main.py. Detection of sample based on net result