horribly hacky script