eliminated unneeded loops in setting markers so that all markers and names are set in one single iteration