a few problems I did in scala