Added my changes to support NES