First attemp at final problem