added testing and fixed binding problems