GPS code integrated with other functions...

The blue link to the library on this page makes things much easier: