Not necessarily working for running im, but made some changes