Some comments and debugging code removed