HUNTINGTON - Police say security cameras captured a man trespassing at Walt Whitman High School in Huntington Station early Friday morning. 

According to police, 35-year-old James Rankin, of Huntington Station, was caught taking a series of pictures on his phone just before 4 a.m. 

Police say Rankin, a Walt Whitman alumnus, had no ill intentions and has been charged with trespassing. Police add that Rankin did not commit any other crime and did not damage or steal anything within the premises.

Rankin, who spoke exclusively with News 12, says he was remembering old times and wanted to take a look around the school.

"I'm really sorry that the parents got scared,” Rankin told News 12. “I understand why. I didn't think.”

Rankin said he was feeling nostalgic and caught up in the moment.

“I was thinking about how if I had a kid when I graduated, they'd be old enough to graduate now,” he says.

Police say the Huntington Station man was working an overnight shift as a taxi driver when he pulled in to a fast food restaurant for some rest. They say he saw his old school nearby and started reminiscing.

According to police, Rankin was able to get inside the school through an unlocked door. School officials say the custodians are supposed to lock the doors at the end of their shifts.  The school superintendent says they are now adding an additional layer of security.