Function works now.