Seperated files and got main functions working