Merger of #122 pull request, return draw matrix for better integration