corrected structure and added support of resources