dynamic_cast(s) added to matrix.cpp; return typed tweaked in matrix.h as needed