merge of old code with new player slider function