Fixed everything added some functionality I think