Changed file structure. Changed constants to sub. Improved writing style.