added custom routing for play and delete actions
improvements to the algorithm robustness