Removed duplicate code that is now in transmat