Fix whitespace and take entire selecting function