generics fixed, basic concurrency added, clean up and testing needed