Cleaned dependencies, moved parent matrix setting before it is used
debugging