Merge Bhander and Xtian code