added code for thomas