Now using path.extname() to get file extension
updated readme