Modified to work with select()