Added and reorganized code for lab 2. See comments. There might be some problems with tabs