worked now (first ugly version)