Eliminated magic numbers and Fixes #13