Created new algorithm that returns indexes of touched pieces in all six directions.