adding control structures in scala