modified to better syntax