Manual merge with khalid's changes