Alright, don't know where you are at exactly with your current code, but take those requirements you understand one at a time and implement them in a fashion it was shown earlier in this
thread, slowly by running the code each time to ensure it works as expected. Really that's not a hard exercise.
Please show us what you have now and which part you are still unsure about?