revised code after sat group meeting