added tests and allowed it to run with check() and stuff