rewrote dropBaseMarkup to make it easier to read