lil more efficient. fixed a bug with editor