re-added rest of code