Getting selection function working.