Removed redundant code
Added errorhandling for smaller than 2