Program execution finally working properly