not perfect, but close - justify algorihtm