added case insensitivity to markup and some cleanup.