2048 crudely ported to Matlab