Got rid of extraneous ends