code fixing and many updates