write test and refactor StateValue object to add limit to speed and altitude