Update utils.py

Resolves #45