use smart pointer to wrap list, set, tuple and dict
move output to writer file, fix listcomp