did some code arrangements