Updated main, but not working completely yet