Line making bugs fixed, except algorithm