Added argument validation
Added argument validation
rewrited, renamed functions
renamed functions