clearin wildness of the code and adding some major functionality