use 'command -v' instead of 'type-p'