Solve function kinda works