added states to the Door code