Make scale find friend frequencies in both directions

Also use difference (< 1) instead of Math.floor