attempted optimisation of øving 6