Merged script from Luke