redesign hiacg based on page example
data structure and codes modified to suit database changes
make use of new data structure and bug fix