Added missing function nextpow2
Updated CalcTA to be more data folder aware