addded resource management to mesh class