fixed stupid for loop in calFUNC

SCREW PHP AND ITS STUPID $$$$$$$$$$

Signed-off-by: Bradley Duncan <bradleydunc@gmail.com>