Re-wrote code on the Foundation Framework