Fixed errors, nearly done with implementation