Updated solve fn to use recursion, added -main fn