removed ternary operator and replaced with an IF block.  added parameter attributes and argument range checking for constructor