Added missing files, code cleanup