a toy implementation of h2o not sure if it's correct