Fixed my Issues with Functions

Fixed my Issues with Functions and came out with a working product. I
realize now that I messed up with the data storage part.