Fix rest of code