improved testing function with an output class format, but need to implement multi-threading now
(#325)