Modified code

Kept all the prototype declared elements at one place as global
variables.