My code for PAT