three working functions: put create expand almostworking free function