some wekend work

WARNING: code is in an unstale state, it won't compile