Copied more from ding_bookmark, and modified to suit our needs. REOL-25