remove unneccessary condition
add tests
add non-numpy version
adjusted visualization