working on python/hw5: last function