Changed best features of the code to xmp