Updated code from Main branch