Added beggar and fixed bugs