Trying to adjust the code so that it would work with insets too; not working yet
Removed inset code for now and fixed existing bugs in the project, now the UI seems to work more consistently