I agree with Chris. I don't know if it was already written: if you want a local function for speed reasons, you can use the classic approach of a main function.