Made almost everything function. Still need to fix some errors