Something was wrong with DACC. Restarting eclipse helped.
Added several functions and bug fixed.
Wrote a manual test to verify result in main.c. It will be moved later.
changed main.c back to original