Edit: Merapikan kode jadi fungsi-fungsi