Changed variable & function names to be more precise and legible. Changed .substring implementation to .charAt.