added some scala magic