algorithm working already, but not optimal yet