Adding completed code so far