debugging and code finalization