fixed isatty bug
removed dependency on calc/bc since expr seems to work here (with dash but maybe not ash)