data analysis seems to work, ready for testing and debugging