Pretty much everything working. Still need to add some error checks and comment some stuff