Added writeBytes function that takes in account for breakpoints