Function add rew
Function "add" rewrited
Some bugs after previous commit fixed