Hopefully I didn't change too much since this version worked