add two implementation
replace with rewrited version