Updated copypaste to match live code
Begin clearing function for reuse