got it finally working properly the code needs to be made neater but i have to switch to another project