reorganized files and fixed supervisor behaviour