updated code for Tyler