Changes the structure of ex. 1
Fixes small error in main code