added unittest functionality