Take a look at this link. Your algorithm falls under the "Naive methods" and can be improved.

Do they not have google where you're at? This took about 30 seconds to find.