Thanks for the replies guys. The 10 year long residence can be made up of legal stay under any status, including student status, so the problem is the gap I mentioned in my first post. So basically I left before one visa finished and came in again with another visa, and there was a one month gap ...