Slight bug with  variable still left in