implemented insertionsort
added 'sorted' measure