work in progress but compilable at least