A few issues (Undefined output) and a few questions