minor bugs
update_counts done
clean up initialisation