Incorporated changes from Jesse