Added frame allocation
Fixed frame allocation and initialisation