updating structure and code