Removed code indentation for readability purposes.
Edited code blocks to use the appropiate language.
Tweaked variable naming to be more consistent