added majority of line functionality