fixed most compatibility bugs and uncommented unneeded lines of code (Sorry)