Second HW submission - split to 4 R files