The computer relies on more than 500,000 lines of code used to create perception , planning and behavioral software to " reason " about traffic and take safe actions while driving to its destination .