Commit #5

Code Fixes and Initialize as a function