cleanup code and remove debug