add function list
added check weather arguments of function are given as valid list
add comments
improved the method to hande exit code