added play logic