put all functions inside athl_fun, added location function