replaced a bit of silly code