changed function to symmetric matrix #33

Fixes bug in issue #33