self implementation done with evaluation and better solution