implemented getRange method