Add main file for lab 3
Updated efficiency and readability of code