refactored to use update-alternatives manually