began process of modularizing coin functions