added list class, and exception handling