updated to latest code