change dirname(__FILE__) to __DIR__, closes #83