Does anyone know about a good way to accomplish this task? Currently i\'m doing it more ore less this way, but i\'m feeling someway unhappy with this code, unable to say what i could immediately impr