refactoring on some packages, and
http://community.topcoder.com/stat?c=problem_statement&pm=12275&rd=15187