Working on fixing reference issues