fixing bug with assigning electron direction