added printing lines for testing
cleanup of do_allocalgorithm, added some printings