added Python 3 check and which uses imp.reload rather than reload