added LOG_FUNCTION
using refactor, convert to modern objective-c syntax
added code to prevent crash when ASPolyline.finalPath is empty, or nil
convert to modern objective-c syntax and remove some unnecessary conversion