Splitted into files; now compiles and runs