Finished completely untested version of half_alloc
Significantly shorter but most likely needs bug fixing