1. probably there is an error in compiling "sum". This is not surprising, since sum evaluates its first argument in an irregular way. 2. there is probably no advantage to compiling this function or any other unless you use modedeclare to declare the types of some or all of the items you use in arithmetic. RJF