start merge into new theano code