added more q logic