Modified to work with os3 environment