Suggested code was working perfectly with minor changes. This code includes your suggested code