Issue #1 fixed, code is now structured properly