removed uncommented import and rearranged code