solution now fully working
fixed some minor issues