Reworked a lot.

Signed-off-by: Wolftein <agustin.l.alvarez@hotmail.com>