split into separate files and added Xcode workspace