added check_dependency() function, exit codes implemented as constants