fyp working code