dirty but works! now I need tests and ci...