refactoread; added selection algorithm
added collections and dp