change signature to include transpose type and improved scaladoc