fixed several bugs and finished cmp, add and sub