removed duplicate code and included required import os
Merge pull request #33 from mpath/extra_function

removed duplicate code and included required import os