Added exceptions to magic numbers, and updated unit test to reflect the new design.