Commented out debugging code, did some improvements, works