i got this code here to log nicknames

Code:
on *:JOIN:#: {
  if (!$read(nicks.txt, sn, $address) { write nicks.txt $address $nick }
  else { write -l $+ $readn nicks.txt $address $read(nicks.txt, sn, $address) $nick }
}


but how would i make it so that if the user already has 15 logs for him, then it will put his new nickname to the beginning

so basically the maximum nicknames it will log for users is 15 keeping the list the most up to date nicks