Initial commit of stub allocation algorithm