modifying functions to be more accurate and pythonic