renaming and rearranging functions. also changed issue