made code more... pythonic