Fixed multiple errors; the code is more functional. Still working on some issues.