Reorganized files + bug fixes