moving main solution into lib file