Added validation logic.
Reduced overall line length by using shorts for several variables.
Added further explanations to the readme file.