updated code to one file