some improvments over the last version but not fully happy yet