Improved input; added partition number validation