Changed tab escapes to spaces and made end() echo instead of return.