updated foundation and code layout