Deleting some unnecesary output..
and simplified an if condition..