added opitonal arguments to solve function