Added first version of main code