Made mark_ouput.py a bit cleaner, could possible refactor out the whole marking logic into a function