Finish Init function. Add function for allocation and deallocation three-dimentional arrays.