thnx for the replies guys... Lykurg, your program worked... I guess I have to use a return statement in the end..