Add entry function almost done