fixed some bugs
fixed merge conflicts
Add sum field; Add aim_to_line function