add foundation and do a lot of changes