wip updating the code to work properly
wip