added function for sleecting data of precise length