removed comments and some debugging printfs