added code for testing of memory use with encapsulation