updated to use foundation lib