Weijian Zhou and Yanyan Zhang for iteration 5

Code refactoring so that the file becomes neat and easily
understandable.