What exactly is this code trying to do?