added show function and did some code clean