Reformatted. Changed Vector to ArrayList.

1. Reformat the codes.
2. Change all Vector to use List interface and implement ArrayList.
3. Add some comments and adjust some variable names.