part of code fix
addressed eliu's latest comments