added line scans. some bug fixes