duplicate marker check, better flags, removed some bugs, added variable triangle rendering