Refactored folders and fixed pointer bug