Devise better way  to make code work.