added timeword function to matrix module