algorithms structuring