improved show function