made some local changes for code to work