made code more magic