changed memory_buffer to memory_percentage
took out memory_buffer variable
added unit test for dynamic memory allocation