added line clearing and shifting