Q made minor changes and added constants