improved output
added end gap