Added code to get intensity profile