First implementation, please dont use without knowing what you do