Do'd some stuff, no idea if its correct, will fix it after AI lab