updated with the general solution