DOESNT COMPILE
prior final
added minor changes to avoidance algorithm