Putting marker creation in a function.