almost working, but still some problems...