added some makesfiles and refactored the main line