fix wrong codes
finalize the design