Init, stolen from swannodette