added memory analysis