* cleaned up code and added IPT_BASEDIR