fixed some errors and added a test problem