implemented changes from test branch