fixed and working, forgot to add base cases