Some improvements

I corrected some wrong code and made better :-)