implemented 2d haar doing one iteration at a time for rows then columns