added discussion and fixed some design issues