First two problems in swift