More stack code, add missing copyright notice