my modified version of marked