added smart line mode