second submission. Improved and cleaned some files