split source code into separate files and added gitignore