Check out @Masire solution to RPA Challenge about a similar situation:
It should give you a good start.