fixing some pythonic stuff