oh I wish I had written this code myself and knew what it was doing ..... :)