Made script less python notebook and more pythonic.