Updated foundation routine