fixed bug that prevented distance variables from being declared