function name changed and output is enhanced