updated code accordingly

check the out puts