Displaying multiple variables in for loop

Hi!
I've run into a problem where my variables are displayed in the wrong order. Basically I'm supposed to use a file that has information like this username:firstname:lastname:etc:etc.
What I'm interested in doing is reformating it into a something more like this: username lastname, firstname.

This is the code I have so far:

#!/bin/sh
#This script will read a file and then display the important #details: username and full name.
#The list will be sorted by last name.

for i in 29
do

 USER_ID=$(sort -t: -k3 studenter.txt | head -$i | cut -c1-8)
 FIRST_NAME=$(sort -t: -k3 studenter.txt | head -$i | cut -f2 -d:)
 LAST_NAME=$(sort -t: -k3 studenter.txt | head -$i | cut -f3 -d:)
 echo "$USER_ID   $LAST_NAME, $FIRST_NAME"

done

When I run it in terminal it just displays all the usernames and then lastnames and then firstnames.

Thank you in advance!

Is this a homework assignment? Homework and coursework questions can only be posted in the Homework & Coursework forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

If you did post homework in the main forums, please review the guidelines for posting homework and repost. If this is not a homework assignment, please post a sample of the your input file and show us the corresponding output you hope to produce from that sample input.

Ok! Thanks!