new changes, extracted show function outside