adding goto line beg and end