Getting expected output