Removed unneeded function get(). Re-indented the code. Changed scope of global variables to static.