updated for applicatives