Added python logic