found a way to make the code more efficent and deal with the reference, I'll think during the night if is the case to rewrite some code