Added variable IR locations

Added  code to deal with different IR locations