change the code style, do some part of extra credit