Calculator working, with test mode and structured code