adding final code solutions