merged wit latest code