rewrote execute function