Adds main function to run editor