added tests for accuracy and speed along with helper functions for testing