removed unused code and updated xmax version