Dead end estprediction implemented, seems to be a memory leak in the given code?