Pretty much finished base functionality