Add @tailrec and slightly alter condition in week 1 assignment