better code , work in progress, please... try to understand