Removed testing/debugging code, ready to merge