added more options to control connection line amount and behaviour