add AutoAlocation
merge and fixes