a bit ugly, but proofs work