Code till lecture02 and slide02 of Stanford CS0107 and CS0106B respectively