code basically finished