bash script for testing the algorithm