function to get data done litle tweaking may be required